/**
 * 文章预览页
 */
import React from "react";
import ArticleBody from "../components/article-body";
import {ACTIVITY_RULE_ID, INVESTMENT_BIBLE_ID} from "../consts";
import {Link} from "react-router";
import Tool from '../components/tool';
export default class Activity extends React.Component {
	constructor(...props) {
		super(...props);
		this.state = {
			active: ACTIVITY_RULE_ID
		};
	}

	componentDidMount() {
		Tool.setPageTitle('活动介绍');
	}

	render() {
		return (
				<div className="pages site-news has-header has-footer">
					<div className="components site-header">
						<div onClick={()=>this.setState({active:ACTIVITY_RULE_ID})} className={this.state.active===ACTIVITY_RULE_ID?'active':null}>活动规则</div>
						<div onClick={()=>this.setState({active:INVESTMENT_BIBLE_ID})} className={this.state.active===INVESTMENT_BIBLE_ID?'active':null}>投资宝典</div>
						<Link to="/win">获奖名单</Link>
					</div>
					<ArticleBody id={this.state.active}/>
					<div className="components site-footer">
						<Link className="safe-protect" to="/safe">安全保障</Link>
						<Link className="join-activity" to="/shake">参与活动</Link>
					</div>
				</div>
		)
	}
}
Activity.contextTypes = {
	router: React.PropTypes.object.isRequired
};